#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
char* my_strstr(const char* str1, const char* str2)
{
	assert(str1 && str2);
	if (*str2 == '\0')
		return (char*)str1;
	char* s1 = (char*)str1;
	char* s2 = (char*)str2;
	while (*s1)
	{
		while (*s1 != *s2&&*s1!='\0')
		{
			s1++;
		}
		if (*s1 == '\0')
			break;
		char* p = s1;
		while (*s1 == *s2&&*s2!='\0')
		{
			s1++;
			s2++;
		}
		if (*s2 == '\0')
			return p;
		p++;
		s1 = p;
		s2 = (char*)str2;
	}
	return (NULL);
}
int main()
{
	char arr1[] = "abbbcdef";
	char arr2[] = "bbc";
	printf("%s", my_strstr(arr1, arr2));
	return 0;
}